import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant'
import 'vant/lib/index.css'
import * as ajax from './request'
import tracking from 'tracking'
Vue.use(tracking)
Vue.prototype.$http = ajax
Vue.use(Vant)
Vue.config.productionTip = false

// 全局混入：mixin里面的每一个选项都会混入到每一个组件里，也就是说这里定义的东西每个组件都可以用
Vue.mixin({
  filters: {
    over99 (v) {
      return v > 99 ? '99+' : v
    },
    toFix2 (v) {
      return v.toFixed(1)
    },
    over10000 (v) {
      return v > 10000 ? (v / 10000).toFixed(1) + 'w' : v
    }
  }
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
